/*
 * @Description: 
 * @Author: zoe
 * @Date: 2024-09-18 19:37:34
 * @LastEditors: rendc
 * @LastEditTime: 2024-09-19 19:43:50
 */
//基类
import java.util.Objects;
public abstract class Automobile{
    private String brand;
    private String platenumber;

    public Automobile(String brand,String platenumber){
        this.brand = brand;
        this.platenumber = platenumber;
    }
    public String getBrand(){
        return brand;
    }
    public void setBrand(String brand){
        this.brand = brand;
    }
    public String getPlatenumber(){
        return platenumber;
    }
    public void setPlatenumber(String platenumber){
        this.platenumber = platenumber;
    }
    //重写
    public boolean equals(Object o){
        if (this == o)return true;
        if (o  == null || getClass() != o.getClass())return false;
        Automobile that = (Automobile) o;
        return Objects.equals(brand.that.brand) && Objects.equals(platenumber,that.platenumber);
    }
    public int hashCode(){
        return Objects.hash(brand,platenumber);
    }
    public String toString(){
        return "Automobile{" +
                "brand='" + brand + '\'' +
                ", platenumber='" + platenumber + '\'' +
                '}';
    }
    public abstract double getRent();

}
